#include "AudioManager.h"
#include "FontManager.h"
#include "ResourceManager.h"  
#include "TextureManager.h"  

#include <SDL2/SDL.h>
#include <SDL2/SDL_ttf.h>

using namespace engine::resource;

engine::resource::ResourceManager::ResourceManager(SDL_Renderer* renderer)  
{  
    m_audioManager = std::make_unique<AudioManager>();
    m_fontManager = std::make_unique<FontManager>();
    m_textureManager = std::make_unique<TextureManager>(renderer);
}  

engine::resource::ResourceManager::~ResourceManager()  
{

}  

SDL_Texture* engine::resource::ResourceManager::loadTexture(const std::string& filePath)  
{  
	return m_textureManager->loadTexture(filePath);
}  

SDL_Texture* engine::resource::ResourceManager::getTexture(const std::string& filePath)  
{  
	return m_textureManager->getTexture(filePath);
}  

void engine::resource::ResourceManager::unloadTexture(const std::string& filePath)  
{  
	return m_textureManager->unloadTexture(filePath);
}  

void engine::resource::ResourceManager::clearTextures()  
{  
	return m_textureManager->clearTexture();
}

Mix_Music* engine::resource::ResourceManager::loadMusic(const std::string& filePath)
{
	return m_audioManager->loadMusic(filePath);
}
Mix_Music* engine::resource::ResourceManager::getMusic(const std::string& filePath)
{
	return m_audioManager->getMusic(filePath);
}
void  engine::resource::ResourceManager::unloadMusic(const std::string& filePath)
{
	return m_audioManager->unloadMusic(filePath);
}
void  engine::resource::ResourceManager::clearMusics()
{
	return m_audioManager->clearMusics();
}

TTF_Font* engine::resource::ResourceManager::loadFont(const std::string& filePath, int fontSize)
{
	return m_fontManager->loadFont(filePath, fontSize);
}

TTF_Font* engine::resource::ResourceManager::getFont(const std::string& filePath, int fontSize)
{
	return m_fontManager->getFont(filePath, fontSize);
}

void engine::resource::ResourceManager::unloadFont(const std::string& filePath, int fontSize)
{
	return m_fontManager->unloadFont(filePath, fontSize);	
}

void engine::resource::ResourceManager::clearFonts()
{
	return m_fontManager->clearFonts();	
}

Mix_Chunk* engine::resource::ResourceManager::loadSound(const std::string& filePath)
{
	return m_audioManager->loadSound(filePath);
}
Mix_Chunk* engine::resource::ResourceManager::getSound(const std::string& filePath)
{
	return m_audioManager->getSound(filePath);
}
void engine::resource::ResourceManager::unloadSound(const std::string& filePath)
{
	return m_audioManager->unloadSound(filePath);	
}
void engine::resource::ResourceManager::clearSounds()
{
	return m_audioManager->clearSounds();
}